﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="泛类型.aspx.cs" Inherits="泛类型" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>Untitled Page</title>
    <style type="text/css">


.posthead
{
	background-color: #eeeeee;
	background-image: url('http://www.cnblogs.com/Skins/KJC/images/icon-titledoc.gif');
	background-position: 5px center;
	background-repeat: no-repeat;
	border-bottom: 1px solid #CCCCCC;
	padding: 4 4 4 25;
	color: #444444;
	font-size: 13px;
}

a
{
	color: #223355;
	text-decoration: none;
}

.postbody
{
 	padding: 4px;
	margin-bottom: 14px;
	line-height:150%;
}

.postbody a
{
	color: #1D58D1;
}


    </style>
</head>
<body>
    <form id="form1" runat="server">
    <div>
    
        <div class="posthead">
            Posted on 2007-02-10 23:02 <a href="http://webabcd.cnblogs.com/">webabcd</a> 
            阅读(2341) <a href="#Post">评论(9)</a> &nbsp;<a 
                href="http://www.cnblogs.com/webabcd/admin/EditPosts.aspx?postid=647154">编辑</a> 
            &nbsp;<a id="lnkFavorite647154" href="#" 
                onclick="Favorite(647154,'C# 2.0 泛型','http://www.cnblogs.com/webabcd/archive/2007/02/10/647154.html',this);return false">收藏</a> 
            所属分类: <a href="http://www.cnblogs.com/webabcd/category/82053.html">C#</a>
            <img height="1" 
                src="http://www.cnblogs.com/webabcd/aggbug/647154.html?webview=1" width="1" /> <!--
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/">
<rdf:Description
rdf:about="http://www.cnblogs.com/webabcd/archive/2007/02/10/647154.html"
dc:identifier="http://www.cnblogs.com/webabcd/archive/2007/02/10/647154.html"
dc:title="C# 2.0 泛型"
trackback:ping="http://www.cnblogs.com/webabcd/services/trackbacks/647154.aspx" />
</rdf:RDF>
-->
        </div>
        <div class="postbody">
            <a href="http://www.cnblogs.com/Files/webabcd/CSharp.rar">[源码下载]</a><br />
            <br />
            <br />
            <div align="center">
                C# 2.0 泛型<br />
            </div>
            <br />
            <br />
            作者：<a href="http://webabcd.cnblogs.com/" target="_blank">webabcd</a><br />
            <br />
            <br />
            介绍<br />
            泛型是 C# 2.0 
            的最强大的功能。通过泛型可以定义类型安全的数据结构，而无须使用实际的数据类型。这能够显著提高性能并得到更高质量的代码，因为您可以重用数据处理算法。<br />
            <br />
            <br />
            泛型类<br />
            <div style="BORDER-RIGHT: #cccccc 1px solid; PADDING-RIGHT: 5px; BORDER-TOP: #cccccc 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 13px; PADDING-BOTTOM: 4px; BORDER-LEFT: #cccccc 1px solid; WIDTH: 98%; WORD-BREAK: break-all; PADDING-TOP: 4px; BORDER-BOTTOM: #cccccc 1px solid; BACKGROUND-COLOR: #eeeeee">
                <img id="Codehighlighter1_0_28_Open_Image" align="top" 
                    onclick="this.style.display='none'; Codehighlighter1_0_28_Open_Text.style.display='none'; Codehighlighter1_0_28_Closed_Image.style.display='inline'; Codehighlighter1_0_28_Closed_Text.style.display='inline';" 
                    src="http://www.cnblogs.com/Images/OutliningIndicators/ExpandedBlockStart.gif" /><img 
                    id="Codehighlighter1_0_28_Closed_Image" align="top" 
                    onclick="this.style.display='none'; Codehighlighter1_0_28_Closed_Text.style.display='none'; Codehighlighter1_0_28_Open_Image.style.display='inline'; Codehighlighter1_0_28_Open_Text.style.display='inline';" 
                    src="http://www.cnblogs.com/Images/OutliningIndicators/ContractedBlock.gif" /><span 
                    id="Codehighlighter1_0_28_Closed_Text" 
                    style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff">/**/</span><span 
                    id="Codehighlighter1_0_28_Open_Text"><span style="COLOR: #008000">/*---<br />
                <img align="top" 
                    src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" />&nbsp;*&nbsp;如何&nbsp;使用&nbsp;和&nbsp;继承&nbsp;泛型类<br />
                <img align="top" 
                    src="http://www.cnblogs.com/Images/OutliningIndicators/ExpandedBlockEnd.gif" />---*/</span></span><span 
                    style="COLOR: #000000"><br />
                <img align="top" 
                    src="http://www.cnblogs.com/Images/OutliningIndicators/None.gif" /></span><span 
                    style="COLOR: #0000ff">using</span><span style="COLOR: #000000">&nbsp;System;<br />
                <img align="top" 
                    src="http://www.cnblogs.com/Images/OutliningIndicators/None.gif" /></span><span 
                    style="COLOR: #0000ff">using</span><span style="COLOR: #000000">&nbsp;System.Collections.Generic;<br />
                <img align="top" 
                    src="http://www.cnblogs.com/Images/OutliningIndicators/None.gif" /><br />
                <img align="top" 
                    src="http://www.cnblogs.com/Images/OutliningIndicators/None.gif" /></span><span 
                    style="COLOR: #008000">//&nbsp;泛型类<br />
                <img align="top" 
                    src="http://www.cnblogs.com/Images/OutliningIndicators/None.gif" /></span><span 
                    style="COLOR: #0000ff">public</span><span style="COLOR: #000000">&nbsp;</span><span 
                    style="COLOR: #0000ff">class</span><span style="COLOR: #000000">&nbsp;GenericClass&lt;T&gt;<br />
                <img id="Codehighlighter1_115_268_Open_Image" align="top" 
                    onclick="this.style.display='none'; Codehighlighter1_115_268_Open_Text.style.display='none'; Codehighlighter1_115_268_Closed_Image.style.display='inline'; Codehighlighter1_115_268_Closed_Text.style.display='inline';" 
                    src="http://www.cnblogs.com/Images/OutliningIndicators/ExpandedBlockStart.gif" /><img 
                    id="Codehighlighter1_115_268_Closed_Image" align="top" 
                    onclick="this.style.display='none'; Codehighlighter1_115_268_Closed_Text.style.display='none'; Codehighlighter1_115_268_Open_Image.style.display='inline'; Codehighlighter1_115_268_Open_Text.style.display='inline';" 
                    src="http://www.cnblogs.com/Images/OutliningIndicators/ContractedBlock.gif" /></span><span 
                    id="Codehighlighter1_115_268_Closed_Text" 
                    style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><img 
                    src="http://www.cnblogs.com/Images/dot.gif" /></span><span 
                    id="Codehighlighter1_115_268_Open_Text"><span style="COLOR: #000000">{<br />
                <img align="top" 
                    src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" />&nbsp;&nbsp;&nbsp;&nbsp;</span><span 
                    style="COLOR: #008000">//&nbsp;返回泛型的具体类型和ToString()后的值<br />
                <img align="top" 
                    src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" /></span><span 
                    style="COLOR: #000000">&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #0000ff">public</span><span 
                    style="COLOR: #000000">&nbsp;</span><span style="COLOR: #0000ff">virtual</span><span 
                    style="COLOR: #000000">&nbsp;</span><span style="COLOR: #0000ff">string</span><span 
                    style="COLOR: #000000">&nbsp;Output(T&nbsp;t)<br />
                <img id="Codehighlighter1_190_266_Open_Image" align="top" 
                    onclick="this.style.display='none'; Codehighlighter1_190_266_Open_Text.style.display='none'; Codehighlighter1_190_266_Closed_Image.style.display='inline'; Codehighlighter1_190_266_Closed_Text.style.display='inline';" 
                    src="http://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif" /><img 
                    id="Codehighlighter1_190_266_Closed_Image" align="top" 
                    onclick="this.style.display='none'; Codehighlighter1_190_266_Closed_Text.style.display='none'; Codehighlighter1_190_266_Open_Image.style.display='inline'; Codehighlighter1_190_266_Open_Text.style.display='inline';" 
                    src="http://www.cnblogs.com/Images/OutliningIndicators/ContractedSubBlock.gif" />&nbsp;&nbsp;&nbsp;&nbsp;</span><span 
                    id="Codehighlighter1_190_266_Closed_Text" 
                    style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><img 
                    src="http://www.cnblogs.com/Images/dot.gif" /></span><span 
                    id="Codehighlighter1_190_266_Open_Text"><span style="COLOR: #000000">{<br />
                <img align="top" 
                    src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span 
                    style="COLOR: #0000ff">return</span><span style="COLOR: #000000">&nbsp;&quot;类型：&quot;&nbsp;+&nbsp;t.GetType().ToString()&nbsp;+&nbsp;&quot;；值：&quot;&nbsp;+&nbsp;t.ToString();<br />
                <img align="top" 
                    src="http://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockEnd.gif" />&nbsp;&nbsp;&nbsp;&nbsp;}</span></span><span 
                    style="COLOR: #000000"><br />
                <img align="top" 
                    src="http://www.cnblogs.com/Images/OutliningIndicators/ExpandedBlockEnd.gif" />}</span></span><span 
                    style="COLOR: #000000"><br />
                <img align="top" 
                    src="http://www.cnblogs.com/Images/OutliningIndicators/None.gif" /><br />
                <img align="top" 
                    src="http://www.cnblogs.com/Images/OutliningIndicators/None.gif" /></span><span 
                    style="COLOR: #008000">//&nbsp;继承自一个泛型类，指定基类的泛型的具体类型<br />
                <img align="top" 
                    src="http://www.cnblogs.com/Images/OutliningIndicators/None.gif" /></span><span 
                    style="COLOR: #0000ff">public</span><span style="COLOR: #000000">&nbsp;</span><span 
                    style="COLOR: #0000ff">class</span><span style="COLOR: #000000">&nbsp;InheritClass1&nbsp;:&nbsp;GenericClass&lt;</span><span 
                    style="COLOR: #0000ff">string</span><span style="COLOR: #000000">&gt;<br />
                <img id="Codehighlighter1_346_349_Open_Image" align="top" 
                    onclick="this.style.display='none'; Codehighlighter1_346_349_Open_Text.style.display='none'; Codehighlighter1_346_349_Closed_Image.style.display='inline'; Codehighlighter1_346_349_Closed_Text.style.display='inline';" 
                    src="http://www.cnblogs.com/Images/OutliningIndicators/ExpandedBlockStart.gif" /><img 
                    id="Codehighlighter1_346_349_Closed_Image" align="top" 
                    onclick="this.style.display='none'; Codehighlighter1_346_349_Closed_Text.style.display='none'; Codehighlighter1_346_349_Open_Image.style.display='inline'; Codehighlighter1_346_349_Open_Text.style.display='inline';" 
                    src="http://www.cnblogs.com/Images/OutliningIndicators/ContractedBlock.gif" /></span><span 
                    id="Codehighlighter1_346_349_Closed_Text" 
                    style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><img 
                    src="http://www.cnblogs.com/Images/dot.gif" /></span><span 
                    id="Codehighlighter1_346_349_Open_Text"><span style="COLOR: #000000">{<br />
                <img align="top" 
                    src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" /><br />
                <img align="top" 
                    src="http://www.cnblogs.com/Images/OutliningIndicators/ExpandedBlockEnd.gif" />}</span></span><span 
                    style="COLOR: #000000"><br />
                <img align="top" 
                    src="http://www.cnblogs.com/Images/OutliningIndicators/None.gif" /><br />
                <img align="top" 
                    src="http://www.cnblogs.com/Images/OutliningIndicators/None.gif" /></span><span 
                    style="COLOR: #008000">//&nbsp;继承自一个泛型类，基类和子类都是同一泛型<br />
                <img align="top" 
                    src="http://www.cnblogs.com/Images/OutliningIndicators/None.gif" /></span><span 
                    style="COLOR: #0000ff">public</span><span style="COLOR: #000000">&nbsp;</span><span 
                    style="COLOR: #0000ff">class</span><span style="COLOR: #000000">&nbsp;InheritClass2&lt;T&gt;&nbsp;:&nbsp;GenericClass&lt;T&gt;<br />
                <img id="Codehighlighter1_424_552_Open_Image" align="top" 
                    onclick="this.style.display='none'; Codehighlighter1_424_552_Open_Text.style.display='none'; Codehighlighter1_424_552_Closed_Image.style.display='inline'; Codehighlighter1_424_552_Closed_Text.style.display='inline';" 
                    src="http://www.cnblogs.com/Images/OutliningIndicators/ExpandedBlockStart.gif" /><img 
                    id="Codehighlighter1_424_552_Closed_Image" align="top" 
                    onclick="this.style.display='none'; Codehighlighter1_424_552_Closed_Text.style.display='none'; Codehighlighter1_424_552_Open_Image.style.display='inline'; Codehighlighter1_424_552_Open_Text.style.display='inline';" 
                    src="http://www.cnblogs.com/Images/OutliningIndicators/ContractedBlock.gif" /></span><span 
                    id="Codehighlighter1_424_552_Closed_Text" 
                    style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><img 
                    src="http://www.cnblogs.com/Images/dot.gif" /></span><span 
                    id="Codehighlighter1_424_552_Open_Text"><span style="COLOR: #000000">{<br />
                <img align="top" 
                    src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" />&nbsp;&nbsp;&nbsp;&nbsp;</span><span 
                    style="COLOR: #0000ff">public</span><span style="COLOR: #000000">&nbsp;</span><span 
                    style="COLOR: #0000ff">override</span><span style="COLOR: #000000">&nbsp;</span><span 
                    style="COLOR: #0000ff">string</span><span style="COLOR: #000000">&nbsp;Output(T&nbsp;t)<br />
                <img id="Codehighlighter1_469_550_Open_Image" align="top" 
                    onclick="this.style.display='none'; Codehighlighter1_469_550_Open_Text.style.display='none'; Codehighlighter1_469_550_Closed_Image.style.display='inline'; Codehighlighter1_469_550_Closed_Text.style.display='inline';" 
                    src="http://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif" /><img 
                    id="Codehighlighter1_469_550_Closed_Image" align="top" 
                    onclick="this.style.display='none'; Codehighlighter1_469_550_Closed_Text.style.display='none'; Codehighlighter1_469_550_Open_Image.style.display='inline'; Codehighlighter1_469_550_Open_Text.style.display='inline';" 
                    src="http://www.cnblogs.com/Images/OutliningIndicators/ContractedSubBlock.gif" />&nbsp;&nbsp;&nbsp;&nbsp;</span><span 
                    id="Codehighlighter1_469_550_Closed_Text" 
                    style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><img 
                    src="http://www.cnblogs.com/Images/dot.gif" /></span><span 
                    id="Codehighlighter1_469_550_Open_Text"><span style="COLOR: #000000">{<br />
                <img align="top" 
                    src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span 
                    style="COLOR: #0000ff">return</span><span style="COLOR: #000000">&nbsp;&quot;子类实现-类型：&quot;&nbsp;+&nbsp;t.GetType().ToString()&nbsp;+&nbsp;&quot;；值：&quot;&nbsp;+&nbsp;t.ToString();<br />
                <img align="top" 
                    src="http://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockEnd.gif" />&nbsp;&nbsp;&nbsp;&nbsp;}</span></span><span 
                    style="COLOR: #000000"><br />
                <img align="top" 
                    src="http://www.cnblogs.com/Images/OutliningIndicators/ExpandedBlockEnd.gif" />}</span></span><span 
                    style="COLOR: #000000"><br />
                <img align="top" 
                    src="http://www.cnblogs.com/Images/OutliningIndicators/None.gif" /><br />
                <img align="top" 
                    src="http://www.cnblogs.com/Images/OutliningIndicators/None.gif" /></span><span 
                    style="COLOR: #008000">//&nbsp;继承自一个泛型类，指定基类的泛型的具体类型，子类仍然可以是泛型<br />
                <img align="top" 
                    src="http://www.cnblogs.com/Images/OutliningIndicators/None.gif" /></span><span 
                    style="COLOR: #0000ff">public</span><span style="COLOR: #000000">&nbsp;</span><span 
                    style="COLOR: #0000ff">class</span><span style="COLOR: #000000">&nbsp;InheritClass3&lt;Z&gt;&nbsp;:&nbsp;GenericClass&lt;</span><span 
                    style="COLOR: #0000ff">double</span><span style="COLOR: #000000">&gt;<br />
                <img id="Codehighlighter1_643_767_Open_Image" align="top" 
                    onclick="this.style.display='none'; Codehighlighter1_643_767_Open_Text.style.display='none'; Codehighlighter1_643_767_Closed_Image.style.display='inline'; Codehighlighter1_643_767_Closed_Text.style.display='inline';" 
                    src="http://www.cnblogs.com/Images/OutliningIndicators/ExpandedBlockStart.gif" /><img 
                    id="Codehighlighter1_643_767_Closed_Image" align="top" 
                    onclick="this.style.display='none'; Codehighlighter1_643_767_Closed_Text.style.display='none'; Codehighlighter1_643_767_Open_Image.style.display='inline'; Codehighlighter1_643_767_Open_Text.style.display='inline';" 
                    src="http://www.cnblogs.com/Images/OutliningIndicators/ContractedBlock.gif" /></span><span 
                    id="Codehighlighter1_643_767_Closed_Text" 
                    style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><img 
                    src="http://www.cnblogs.com/Images/dot.gif" /></span><span 
                    id="Codehighlighter1_643_767_Open_Text"><span style="COLOR: #000000">{<br />
                <img align="top" 
                    src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" />&nbsp;&nbsp;&nbsp;&nbsp;</span><span 
                    style="COLOR: #0000ff">public</span><span style="COLOR: #000000">&nbsp;</span><span 
                    style="COLOR: #0000ff">string</span><span style="COLOR: #000000">&nbsp;ChildOutput(Z&nbsp;z)<br />
                <img id="Codehighlighter1_684_765_Open_Image" align="top" 
                    onclick="this.style.display='none'; Codehighlighter1_684_765_Open_Text.style.display='none'; Codehighlighter1_684_765_Closed_Image.style.display='inline'; Codehighlighter1_684_765_Closed_Text.style.display='inline';" 
                    src="http://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif" /><img 
                    id="Codehighlighter1_684_765_Closed_Image" align="top" 
                    onclick="this.style.display='none'; Codehighlighter1_684_765_Closed_Text.style.display='none'; Codehighlighter1_684_765_Open_Image.style.display='inline'; Codehighlighter1_684_765_Open_Text.style.display='inline';" 
                    src="http://www.cnblogs.com/Images/OutliningIndicators/ContractedSubBlock.gif" />&nbsp;&nbsp;&nbsp;&nbsp;</span><span 
                    id="Codehighlighter1_684_765_Closed_Text" 
                    style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><img 
                    src="http://www.cnblogs.com/Images/dot.gif" /></span><span 
                    id="Codehighlighter1_684_765_Open_Text"><span style="COLOR: #000000">{<br />
                <img align="top" 
                    src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span 
                    style="COLOR: #0000ff">return</span><span style="COLOR: #000000">&nbsp;&quot;子类实现-类型：&quot;&nbsp;+&nbsp;z.GetType().ToString()&nbsp;+&nbsp;&quot;；值：&quot;&nbsp;+&nbsp;z.ToString();<br />
                <img align="top" 
                    src="http://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockEnd.gif" />&nbsp;&nbsp;&nbsp;&nbsp;}</span></span><span 
                    style="COLOR: #000000"><br />
                <img align="top" 
                    src="http://www.cnblogs.com/Images/OutliningIndicators/ExpandedBlockEnd.gif" />}</span></span><span 
                    style="COLOR: #000000"><br />
                <img align="top" 
                    src="http://www.cnblogs.com/Images/OutliningIndicators/None.gif" /><br />
                <img align="top" 
                    src="http://www.cnblogs.com/Images/OutliningIndicators/None.gif" /><br />
                <img align="top" 
                    src="http://www.cnblogs.com/Images/OutliningIndicators/None.gif" /></span><span 
                    style="COLOR: #0000ff">public</span><span style="COLOR: #000000">&nbsp;partial&nbsp;</span><span 
                    style="COLOR: #0000ff">class</span><span style="COLOR: #000000">&nbsp;Generic_Class&nbsp;:&nbsp;System.Web.UI.Page<br />
                <img id="Codehighlighter1_827_1388_Open_Image" align="top" 
                    onclick="this.style.display='none'; Codehighlighter1_827_1388_Open_Text.style.display='none'; Codehighlighter1_827_1388_Closed_Image.style.display='inline'; Codehighlighter1_827_1388_Closed_Text.style.display='inline';" 
                    src="http://www.cnblogs.com/Images/OutliningIndicators/ExpandedBlockStart.gif" /><img 
                    id="Codehighlighter1_827_1388_Closed_Image" align="top" 
                    onclick="this.style.display='none'; Codehighlighter1_827_1388_Closed_Text.style.display='none'; Codehighlighter1_827_1388_Open_Image.style.display='inline'; Codehighlighter1_827_1388_Open_Text.style.display='inline';" 
                    src="http://www.cnblogs.com/Images/OutliningIndicators/ContractedBlock.gif" /></span><span 
                    id="Codehighlighter1_827_1388_Closed_Text" 
                    style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><img 
                    src="http://www.cnblogs.com/Images/dot.gif" /></span><span 
                    id="Codehighlighter1_827_1388_Open_Text"><span style="COLOR: #000000">{<br />
                <img align="top" 
                    src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" />&nbsp;&nbsp;&nbsp;&nbsp;</span><span 
                    style="COLOR: #0000ff">protected</span><span style="COLOR: #000000">&nbsp;</span><span 
                    style="COLOR: #0000ff">void</span><span style="COLOR: #000000">&nbsp;Page_Load(</span><span 
                    style="COLOR: #0000ff">object</span><span style="COLOR: #000000">&nbsp;sender,&nbsp;EventArgs&nbsp;e)<br />
                <img id="Codehighlighter1_890_1386_Open_Image" align="top" 
                    onclick="this.style.display='none'; Codehighlighter1_890_1386_Open_Text.style.display='none'; Codehighlighter1_890_1386_Closed_Image.style.display='inline'; Codehighlighter1_890_1386_Closed_Text.style.display='inline';" 
                    src="http://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif" /><img 
                    id="Codehighlighter1_890_1386_Closed_Image" align="top" 
                    onclick="this.style.display='none'; Codehighlighter1_890_1386_Closed_Text.style.display='none'; Codehighlighter1_890_1386_Open_Image.style.display='inline'; Codehighlighter1_890_1386_Open_Text.style.display='inline';" 
                    src="http://www.cnblogs.com/Images/OutliningIndicators/ContractedSubBlock.gif" />&nbsp;&nbsp;&nbsp;&nbsp;</span><span 
                    id="Codehighlighter1_890_1386_Closed_Text" 
                    style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><img 
                    src="http://www.cnblogs.com/Images/dot.gif" /></span><span 
                    id="Codehighlighter1_890_1386_Open_Text"><span style="COLOR: #000000">{<br />
                <img align="top" 
                    src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;GenericClass&lt;DateTime&gt;&nbsp;c&nbsp;=&nbsp;</span><span 
                    style="COLOR: #0000ff">new</span><span style="COLOR: #000000">&nbsp;GenericClass&lt;DateTime&gt;();<br />
                <img align="top" 
                    src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Response.Write(c.Output(DateTime.Now)&nbsp;+&nbsp;&quot;&lt;br&nbsp;/&gt;&quot;);<br />
                <img align="top" 
                    src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" /><br />
                <img align="top" 
                    src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;InheritClass1&nbsp;c1&nbsp;=&nbsp;</span><span 
                    style="COLOR: #0000ff">new</span><span style="COLOR: #000000">&nbsp;InheritClass1();<br />
                <img align="top" 
                    src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Response.Write(c1.Output(&quot;abc&quot;)&nbsp;+&nbsp;&quot;&lt;br&nbsp;/&gt;&quot;);<br />
                <img align="top" 
                    src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" /><br />
                <img align="top" 
                    src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;GenericClass&lt;Guid&gt;&nbsp;c2&nbsp;=&nbsp;</span><span 
                    style="COLOR: #0000ff">new</span><span style="COLOR: #000000">&nbsp;InheritClass2&lt;Guid&gt;();<br />
                <img align="top" 
                    src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Response.Write(c2.Output(</span><span 
                    style="COLOR: #0000ff">new</span><span style="COLOR: #000000">&nbsp;Guid())&nbsp;+&nbsp;&quot;&lt;br&nbsp;/&gt;&quot;);<br />
                <img align="top" 
                    src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" /><br />
                <img align="top" 
                    src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;InheritClass3&lt;</span><span 
                    style="COLOR: #0000ff">int</span><span style="COLOR: #000000">&gt;&nbsp;c3&nbsp;=&nbsp;</span><span 
                    style="COLOR: #0000ff">new</span><span style="COLOR: #000000">&nbsp;InheritClass3&lt;</span><span 
                    style="COLOR: #0000ff">int</span><span style="COLOR: #000000">&gt;();<br />
                <img align="top" 
                    src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Response.Write(c3.Output(Math.PI)&nbsp;+&nbsp;&quot;&nbsp;|||&nbsp;&quot;&nbsp;+&nbsp;c3.ChildOutput(123)&nbsp;+&nbsp;&quot;&lt;br&nbsp;/&gt;&quot;);<br />
                <img align="top" 
                    src="http://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockEnd.gif" />&nbsp;&nbsp;&nbsp;&nbsp;}</span></span><span 
                    style="COLOR: #000000"><br />
                <img align="top" 
                    src="http://www.cnblogs.com/Images/OutliningIndicators/ExpandedBlockEnd.gif" />}</span></span></div>
            运行结果<br />
            类型：System.DateTime；值：2007-2-10 22:56:09<br />
            类型：System.String；值：abc<br />
            子类实现-类型：System.Guid；值：00000000-0000-0000-0000-000000000000<br />
            类型：System.Double；值：3.14159265358979 ||| 子类实现-类型：System.Int32；值：123<br />
            <br />
            <br />
            泛型方法<br />
            <div style="BORDER-RIGHT: #cccccc 1px solid; PADDING-RIGHT: 5px; BORDER-TOP: #cccccc 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 13px; PADDING-BOTTOM: 4px; BORDER-LEFT: #cccccc 1px solid; WIDTH: 98%; WORD-BREAK: break-all; PADDING-TOP: 4px; BORDER-BOTTOM: #cccccc 1px solid; BACKGROUND-COLOR: #eeeeee">
                <img id="Codehighlighter1_0_25_Open_Image" align="top" 
                    onclick="this.style.display='none'; Codehighlighter1_0_25_Open_Text.style.display='none'; Codehighlighter1_0_25_Closed_Image.style.display='inline'; Codehighlighter1_0_25_Closed_Text.style.display='inline';" 
                    src="http://www.cnblogs.com/Images/OutliningIndicators/ExpandedBlockStart.gif" /><img 
                    id="Codehighlighter1_0_25_Closed_Image" align="top" 
                    onclick="this.style.display='none'; Codehighlighter1_0_25_Closed_Text.style.display='none'; Codehighlighter1_0_25_Open_Image.style.display='inline'; Codehighlighter1_0_25_Open_Text.style.display='inline';" 
                    src="http://www.cnblogs.com/Images/OutliningIndicators/ContractedBlock.gif" /><span 
                    id="Codehighlighter1_0_25_Closed_Text" 
                    style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff">/**/</span><span 
                    id="Codehighlighter1_0_25_Open_Text"><span style="COLOR: #008000">/*---<br />
                <img align="top" 
                    src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" />&nbsp;*&nbsp;如何&nbsp;使用&nbsp;泛型方法&nbsp;<br />
                <img align="top" 
                    src="http://www.cnblogs.com/Images/OutliningIndicators/ExpandedBlockEnd.gif" />---*/</span></span><span 
                    style="COLOR: #000000"><br />
                <img align="top" 
                    src="http://www.cnblogs.com/Images/OutliningIndicators/None.gif" /></span><span 
                    style="COLOR: #0000ff">using</span><span style="COLOR: #000000">&nbsp;System;<br />
                <img align="top" 
                    src="http://www.cnblogs.com/Images/OutliningIndicators/None.gif" /></span><span 
                    style="COLOR: #0000ff">using</span><span style="COLOR: #000000">&nbsp;System.Collections.Generic;<br />
                <img align="top" 
                    src="http://www.cnblogs.com/Images/OutliningIndicators/None.gif" /><br />
                <img align="top" 
                    src="http://www.cnblogs.com/Images/OutliningIndicators/None.gif" /></span><span 
                    style="COLOR: #0000ff">public</span><span style="COLOR: #000000">&nbsp;</span><span 
                    style="COLOR: #0000ff">class</span><span style="COLOR: #000000">&nbsp;GenericMethod<br />
                <img id="Codehighlighter1_103_242_Open_Image" align="top" 
                    onclick="this.style.display='none'; Codehighlighter1_103_242_Open_Text.style.display='none'; Codehighlighter1_103_242_Closed_Image.style.display='inline'; Codehighlighter1_103_242_Closed_Text.style.display='inline';" 
                    src="http://www.cnblogs.com/Images/OutliningIndicators/ExpandedBlockStart.gif" /><img 
                    id="Codehighlighter1_103_242_Closed_Image" align="top" 
                    onclick="this.style.display='none'; Codehighlighter1_103_242_Closed_Text.style.display='none'; Codehighlighter1_103_242_Open_Image.style.display='inline'; Codehighlighter1_103_242_Open_Text.style.display='inline';" 
                    src="http://www.cnblogs.com/Images/OutliningIndicators/ContractedBlock.gif" /></span><span 
                    id="Codehighlighter1_103_242_Closed_Text" 
                    style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><img 
                    src="http://www.cnblogs.com/Images/dot.gif" /></span><span 
                    id="Codehighlighter1_103_242_Open_Text"><span style="COLOR: #000000">{<br />
                <img align="top" 
                    src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" />&nbsp;&nbsp;&nbsp;&nbsp;</span><span 
                    style="COLOR: #008000">//&nbsp;静态&nbsp;泛型方法<br />
                <img align="top" 
                    src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" /></span><span 
                    style="COLOR: #000000">&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #0000ff">public</span><span 
                    style="COLOR: #000000">&nbsp;</span><span style="COLOR: #0000ff">static</span><span 
                    style="COLOR: #000000">&nbsp;</span><span style="COLOR: #0000ff">string</span><span 
                    style="COLOR: #000000">&nbsp;Output&lt;T&gt;(T&nbsp;t)<br />
                <img id="Codehighlighter1_164_240_Open_Image" align="top" 
                    onclick="this.style.display='none'; Codehighlighter1_164_240_Open_Text.style.display='none'; Codehighlighter1_164_240_Closed_Image.style.display='inline'; Codehighlighter1_164_240_Closed_Text.style.display='inline';" 
                    src="http://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif" /><img 
                    id="Codehighlighter1_164_240_Closed_Image" align="top" 
                    onclick="this.style.display='none'; Codehighlighter1_164_240_Closed_Text.style.display='none'; Codehighlighter1_164_240_Open_Image.style.display='inline'; Codehighlighter1_164_240_Open_Text.style.display='inline';" 
                    src="http://www.cnblogs.com/Images/OutliningIndicators/ContractedSubBlock.gif" />&nbsp;&nbsp;&nbsp;&nbsp;</span><span 
                    id="Codehighlighter1_164_240_Closed_Text" 
                    style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><img 
                    src="http://www.cnblogs.com/Images/dot.gif" /></span><span 
                    id="Codehighlighter1_164_240_Open_Text"><span style="COLOR: #000000">{<br />
                <img align="top" 
                    src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span 
                    style="COLOR: #0000ff">return</span><span style="COLOR: #000000">&nbsp;&quot;类型：&quot;&nbsp;+&nbsp;t.GetType().ToString()&nbsp;+&nbsp;&quot;；值：&quot;&nbsp;+&nbsp;t.ToString();<br />
                <img align="top" 
                    src="http://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockEnd.gif" />&nbsp;&nbsp;&nbsp;&nbsp;}</span></span><span 
                    style="COLOR: #000000"><br />
                <img align="top" 
                    src="http://www.cnblogs.com/Images/OutliningIndicators/ExpandedBlockEnd.gif" />}</span></span><span 
                    style="COLOR: #000000"><br />
                <img align="top" 
                    src="http://www.cnblogs.com/Images/OutliningIndicators/None.gif" /><br />
                <img align="top" 
                    src="http://www.cnblogs.com/Images/OutliningIndicators/None.gif" /><br />
                <img align="top" 
                    src="http://www.cnblogs.com/Images/OutliningIndicators/None.gif" /></span><span 
                    style="COLOR: #0000ff">public</span><span style="COLOR: #000000">&nbsp;partial&nbsp;</span><span 
                    style="COLOR: #0000ff">class</span><span style="COLOR: #000000">&nbsp;Generic_Method&nbsp;:&nbsp;System.Web.UI.Page<br />
                <img id="Codehighlighter1_303_521_Open_Image" align="top" 
                    onclick="this.style.display='none'; Codehighlighter1_303_521_Open_Text.style.display='none'; Codehighlighter1_303_521_Closed_Image.style.display='inline'; Codehighlighter1_303_521_Closed_Text.style.display='inline';" 
                    src="http://www.cnblogs.com/Images/OutliningIndicators/ExpandedBlockStart.gif" /><img 
                    id="Codehighlighter1_303_521_Closed_Image" align="top" 
                    onclick="this.style.display='none'; Codehighlighter1_303_521_Closed_Text.style.display='none'; Codehighlighter1_303_521_Open_Image.style.display='inline'; Codehighlighter1_303_521_Open_Text.style.display='inline';" 
                    src="http://www.cnblogs.com/Images/OutliningIndicators/ContractedBlock.gif" /></span><span 
                    id="Codehighlighter1_303_521_Closed_Text" 
                    style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><img 
                    src="http://www.cnblogs.com/Images/dot.gif" /></span><span 
                    id="Codehighlighter1_303_521_Open_Text"><span style="COLOR: #000000">{<br />
                <img align="top" 
                    src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" />&nbsp;&nbsp;&nbsp;&nbsp;</span><span 
                    style="COLOR: #0000ff">protected</span><span style="COLOR: #000000">&nbsp;</span><span 
                    style="COLOR: #0000ff">void</span><span style="COLOR: #000000">&nbsp;Page_Load(</span><span 
                    style="COLOR: #0000ff">object</span><span style="COLOR: #000000">&nbsp;sender,&nbsp;EventArgs&nbsp;e)<br />
                <img id="Codehighlighter1_366_519_Open_Image" align="top" 
                    onclick="this.style.display='none'; Codehighlighter1_366_519_Open_Text.style.display='none'; Codehighlighter1_366_519_Closed_Image.style.display='inline'; Codehighlighter1_366_519_Closed_Text.style.display='inline';" 
                    src="http://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif" /><img 
                    id="Codehighlighter1_366_519_Closed_Image" align="top" 
                    onclick="this.style.display='none'; Codehighlighter1_366_519_Closed_Text.style.display='none'; Codehighlighter1_366_519_Open_Image.style.display='inline'; Codehighlighter1_366_519_Open_Text.style.display='inline';" 
                    src="http://www.cnblogs.com/Images/OutliningIndicators/ContractedSubBlock.gif" />&nbsp;&nbsp;&nbsp;&nbsp;</span><span 
                    id="Codehighlighter1_366_519_Closed_Text" 
                    style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><img 
                    src="http://www.cnblogs.com/Images/dot.gif" /></span><span 
                    id="Codehighlighter1_366_519_Open_Text"><span style="COLOR: #000000">{<br />
                <img align="top" 
                    src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Response.Write(GenericMethod.Output&lt;</span><span 
                    style="COLOR: #0000ff">int</span><span style="COLOR: #000000">&gt;(23)&nbsp;+&nbsp;&quot;&lt;br&nbsp;/&gt;&quot;);<br />
                <img align="top" 
                    src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Response.Write(GenericMethod.Output&lt;DateTime&gt;(DateTime.Now)&nbsp;+&nbsp;&quot;&lt;br&nbsp;/&gt;&quot;);<br />
                <img align="top" 
                    src="http://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockEnd.gif" />&nbsp;&nbsp;&nbsp;&nbsp;}</span></span><span 
                    style="COLOR: #000000"><br />
                <img align="top" 
                    src="http://www.cnblogs.com/Images/OutliningIndicators/ExpandedBlockEnd.gif" />}</span></span></div>
            运行结果<br />
            类型：System.Int32；值：23<br />
            类型：System.DateTime；值：2007-2-10 22:57:29<br />
            <br />
            <br />
            泛型委托<br />
            <div style="BORDER-RIGHT: #cccccc 1px solid; PADDING-RIGHT: 5px; BORDER-TOP: #cccccc 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 13px; PADDING-BOTTOM: 4px; BORDER-LEFT: #cccccc 1px solid; WIDTH: 98%; WORD-BREAK: break-all; PADDING-TOP: 4px; BORDER-BOTTOM: #cccccc 1px solid; BACKGROUND-COLOR: #eeeeee">
                <img id="Codehighlighter1_0_24_Open_Image" align="top" 
                    onclick="this.style.display='none'; Codehighlighter1_0_24_Open_Text.style.display='none'; Codehighlighter1_0_24_Closed_Image.style.display='inline'; Codehighlighter1_0_24_Closed_Text.style.display='inline';" 
                    src="http://www.cnblogs.com/Images/OutliningIndicators/ExpandedBlockStart.gif" /><img 
                    id="Codehighlighter1_0_24_Closed_Image" align="top" 
                    onclick="this.style.display='none'; Codehighlighter1_0_24_Closed_Text.style.display='none'; Codehighlighter1_0_24_Open_Image.style.display='inline'; Codehighlighter1_0_24_Open_Text.style.display='inline';" 
                    src="http://www.cnblogs.com/Images/OutliningIndicators/ContractedBlock.gif" /><span 
                    id="Codehighlighter1_0_24_Closed_Text" 
                    style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff">/**/</span><span 
                    id="Codehighlighter1_0_24_Open_Text"><span style="COLOR: #008000">/*---<br />
                <img align="top" 
                    src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" />&nbsp;*&nbsp;如何&nbsp;使用&nbsp;泛型委托<br />
                <img align="top" 
                    src="http://www.cnblogs.com/Images/OutliningIndicators/ExpandedBlockEnd.gif" />---*/</span></span><span 
                    style="COLOR: #000000"><br />
                <img align="top" 
                    src="http://www.cnblogs.com/Images/OutliningIndicators/None.gif" /></span><span 
                    style="COLOR: #0000ff">using</span><span style="COLOR: #000000">&nbsp;System;<br />
                <img align="top" 
                    src="http://www.cnblogs.com/Images/OutliningIndicators/None.gif" /></span><span 
                    style="COLOR: #0000ff">using</span><span style="COLOR: #000000">&nbsp;System.Collections.Generic;<br />
                <img align="top" 
                    src="http://www.cnblogs.com/Images/OutliningIndicators/None.gif" /><br />
                <img align="top" 
                    src="http://www.cnblogs.com/Images/OutliningIndicators/None.gif" /></span><span 
                    style="COLOR: #0000ff">public</span><span style="COLOR: #000000">&nbsp;</span><span 
                    style="COLOR: #0000ff">class</span><span style="COLOR: #000000">&nbsp;GenericDelegate<br />
                <img id="Codehighlighter1_104_433_Open_Image" align="top" 
                    onclick="this.style.display='none'; Codehighlighter1_104_433_Open_Text.style.display='none'; Codehighlighter1_104_433_Closed_Image.style.display='inline'; Codehighlighter1_104_433_Closed_Text.style.display='inline';" 
                    src="http://www.cnblogs.com/Images/OutliningIndicators/ExpandedBlockStart.gif" /><img 
                    id="Codehighlighter1_104_433_Closed_Image" align="top" 
                    onclick="this.style.display='none'; Codehighlighter1_104_433_Closed_Text.style.display='none'; Codehighlighter1_104_433_Open_Image.style.display='inline'; Codehighlighter1_104_433_Open_Text.style.display='inline';" 
                    src="http://www.cnblogs.com/Images/OutliningIndicators/ContractedBlock.gif" /></span><span 
                    id="Codehighlighter1_104_433_Closed_Text" 
                    style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><img 
                    src="http://www.cnblogs.com/Images/dot.gif" /></span><span 
                    id="Codehighlighter1_104_433_Open_Text"><span style="COLOR: #000000">{<br />
                <img align="top" 
                    src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" />&nbsp;&nbsp;&nbsp;&nbsp;</span><span 
                    style="COLOR: #008000">//&nbsp;声明一个泛型委托<br />
                <img align="top" 
                    src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" /></span><span 
                    style="COLOR: #000000">&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #0000ff">public</span><span 
                    style="COLOR: #000000">&nbsp;</span><span style="COLOR: #0000ff">delegate</span><span 
                    style="COLOR: #000000">&nbsp;</span><span style="COLOR: #0000ff">string</span><span 
                    style="COLOR: #000000">&nbsp;OutputDelegate&lt;T&gt;(T&nbsp;t);<br />
                <img align="top" 
                    src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" /><br />
                <img align="top" 
                    src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" />&nbsp;&nbsp;&nbsp;&nbsp;</span><span 
                    style="COLOR: #008000">//&nbsp;定义一个静态方法<br />
                <img align="top" 
                    src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" /></span><span 
                    style="COLOR: #000000">&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #0000ff">public</span><span 
                    style="COLOR: #000000">&nbsp;</span><span style="COLOR: #0000ff">static</span><span 
                    style="COLOR: #000000">&nbsp;</span><span style="COLOR: #0000ff">string</span><span 
                    style="COLOR: #000000">&nbsp;DelegateFun(</span><span style="COLOR: #0000ff">string</span><span 
                    style="COLOR: #000000">&nbsp;s)<br />
                <img id="Codehighlighter1_241_294_Open_Image" align="top" 
                    onclick="this.style.display='none'; Codehighlighter1_241_294_Open_Text.style.display='none'; Codehighlighter1_241_294_Closed_Image.style.display='inline'; Codehighlighter1_241_294_Closed_Text.style.display='inline';" 
                    src="http://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif" /><img 
                    id="Codehighlighter1_241_294_Closed_Image" align="top" 
                    onclick="this.style.display='none'; Codehighlighter1_241_294_Closed_Text.style.display='none'; Codehighlighter1_241_294_Open_Image.style.display='inline'; Codehighlighter1_241_294_Open_Text.style.display='inline';" 
                    src="http://www.cnblogs.com/Images/OutliningIndicators/ContractedSubBlock.gif" />&nbsp;&nbsp;&nbsp;&nbsp;</span><span 
                    id="Codehighlighter1_241_294_Closed_Text" 
                    style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><img 
                    src="http://www.cnblogs.com/Images/dot.gif" /></span><span 
                    id="Codehighlighter1_241_294_Open_Text"><span style="COLOR: #000000">{<br />
                <img align="top" 
                    src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span 
                    style="COLOR: #0000ff">return</span><span style="COLOR: #000000">&nbsp;String.Format(&quot;Hello,&nbsp;{0}&quot;,&nbsp;s);<br />
                <img align="top" 
                    src="http://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockEnd.gif" />&nbsp;&nbsp;&nbsp;&nbsp;}</span></span><span 
                    style="COLOR: #000000"><br />
                <img align="top" 
                    src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" /><br />
                <img align="top" 
                    src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" />&nbsp;&nbsp;&nbsp;&nbsp;</span><span 
                    style="COLOR: #008000">//&nbsp;定义一个静态方法<br />
                <img align="top" 
                    src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" /></span><span 
                    style="COLOR: #000000">&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #0000ff">public</span><span 
                    style="COLOR: #000000">&nbsp;</span><span style="COLOR: #0000ff">static</span><span 
                    style="COLOR: #000000">&nbsp;</span><span style="COLOR: #0000ff">string</span><span 
                    style="COLOR: #000000">&nbsp;DelegateFun(DateTime&nbsp;dt)<br />
                <img id="Codehighlighter1_367_431_Open_Image" align="top" 
                    onclick="this.style.display='none'; Codehighlighter1_367_431_Open_Text.style.display='none'; Codehighlighter1_367_431_Closed_Image.style.display='inline'; Codehighlighter1_367_431_Closed_Text.style.display='inline';" 
                    src="http://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif" /><img 
                    id="Codehighlighter1_367_431_Closed_Image" align="top" 
                    onclick="this.style.display='none'; Codehighlighter1_367_431_Closed_Text.style.display='none'; Codehighlighter1_367_431_Open_Image.style.display='inline'; Codehighlighter1_367_431_Open_Text.style.display='inline';" 
                    src="http://www.cnblogs.com/Images/OutliningIndicators/ContractedSubBlock.gif" />&nbsp;&nbsp;&nbsp;&nbsp;</span><span 
                    id="Codehighlighter1_367_431_Closed_Text" 
                    style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><img 
                    src="http://www.cnblogs.com/Images/dot.gif" /></span><span 
                    id="Codehighlighter1_367_431_Open_Text"><span style="COLOR: #000000">{<br />
                <img align="top" 
                    src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span 
                    style="COLOR: #0000ff">return</span><span style="COLOR: #000000">&nbsp;String.Format(&quot;Time,&nbsp;{0}&quot;,&nbsp;dt.ToString());<br />
                <img align="top" 
                    src="http://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockEnd.gif" />&nbsp;&nbsp;&nbsp;&nbsp;}</span></span><span 
                    style="COLOR: #000000"><br />
                <img align="top" 
                    src="http://www.cnblogs.com/Images/OutliningIndicators/ExpandedBlockEnd.gif" />}</span></span><span 
                    style="COLOR: #000000"><br />
                <img align="top" 
                    src="http://www.cnblogs.com/Images/OutliningIndicators/None.gif" /><br />
                <img align="top" 
                    src="http://www.cnblogs.com/Images/OutliningIndicators/None.gif" /><br />
                <img align="top" 
                    src="http://www.cnblogs.com/Images/OutliningIndicators/None.gif" /></span><span 
                    style="COLOR: #0000ff">public</span><span style="COLOR: #000000">&nbsp;partial&nbsp;</span><span 
                    style="COLOR: #0000ff">class</span><span style="COLOR: #000000">&nbsp;Generic_Delegate&nbsp;:&nbsp;System.Web.UI.Page<br />
                <img id="Codehighlighter1_496_973_Open_Image" align="top" 
                    onclick="this.style.display='none'; Codehighlighter1_496_973_Open_Text.style.display='none'; Codehighlighter1_496_973_Closed_Image.style.display='inline'; Codehighlighter1_496_973_Closed_Text.style.display='inline';" 
                    src="http://www.cnblogs.com/Images/OutliningIndicators/ExpandedBlockStart.gif" /><img 
                    id="Codehighlighter1_496_973_Closed_Image" align="top" 
                    onclick="this.style.display='none'; Codehighlighter1_496_973_Closed_Text.style.display='none'; Codehighlighter1_496_973_Open_Image.style.display='inline'; Codehighlighter1_496_973_Open_Text.style.display='inline';" 
                    src="http://www.cnblogs.com/Images/OutliningIndicators/ContractedBlock.gif" /></span><span 
                    id="Codehighlighter1_496_973_Closed_Text" 
                    style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><img 
                    src="http://www.cnblogs.com/Images/dot.gif" /></span><span 
                    id="Codehighlighter1_496_973_Open_Text"><span style="COLOR: #000000">{<br />
                <img align="top" 
                    src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" />&nbsp;&nbsp;&nbsp;&nbsp;</span><span 
                    style="COLOR: #0000ff">protected</span><span style="COLOR: #000000">&nbsp;</span><span 
                    style="COLOR: #0000ff">void</span><span style="COLOR: #000000">&nbsp;Page_Load(</span><span 
                    style="COLOR: #0000ff">object</span><span style="COLOR: #000000">&nbsp;sender,&nbsp;EventArgs&nbsp;e)<br />
                <img id="Codehighlighter1_559_971_Open_Image" align="top" 
                    onclick="this.style.display='none'; Codehighlighter1_559_971_Open_Text.style.display='none'; Codehighlighter1_559_971_Closed_Image.style.display='inline'; Codehighlighter1_559_971_Closed_Text.style.display='inline';" 
                    src="http://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif" /><img 
                    id="Codehighlighter1_559_971_Closed_Image" align="top" 
                    onclick="this.style.display='none'; Codehighlighter1_559_971_Closed_Text.style.display='none'; Codehighlighter1_559_971_Open_Image.style.display='inline'; Codehighlighter1_559_971_Open_Text.style.display='inline';" 
                    src="http://www.cnblogs.com/Images/OutliningIndicators/ContractedSubBlock.gif" />&nbsp;&nbsp;&nbsp;&nbsp;</span><span 
                    id="Codehighlighter1_559_971_Closed_Text" 
                    style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><img 
                    src="http://www.cnblogs.com/Images/dot.gif" /></span><span 
                    id="Codehighlighter1_559_971_Open_Text"><span style="COLOR: #000000">{<br />
                <img align="top" 
                    src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span 
                    style="COLOR: #008000">//&nbsp;使用泛型委托<br />
                <img align="top" 
                    src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" /></span><span 
                    style="COLOR: #000000">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;GenericDelegate.OutputDelegate&lt;</span><span 
                    style="COLOR: #0000ff">string</span><span style="COLOR: #000000">&gt;&nbsp;delegate1<br />
                <img align="top" 
                    src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=&nbsp;</span><span 
                    style="COLOR: #0000ff">new</span><span style="COLOR: #000000">&nbsp;GenericDelegate.OutputDelegate&lt;</span><span 
                    style="COLOR: #0000ff">string</span><span style="COLOR: #000000">&gt;(GenericDelegate.DelegateFun);<br />
                <img align="top" 
                    src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" /><br />
                <img align="top" 
                    src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Response.Write(delegate1(&quot;aabbcc&quot;));<br />
                <img align="top" 
                    src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Response.Write(&quot;&lt;br&nbsp;/&gt;&quot;);<br />
                <img align="top" 
                    src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" /><br />
                <img align="top" 
                    src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span 
                    style="COLOR: #008000">//&nbsp;使用泛型委托（匿名方法）<br />
                <img align="top" 
                    src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" /></span><span 
                    style="COLOR: #000000">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;GenericDelegate.OutputDelegate&lt;DateTime&gt;&nbsp;delegate2&nbsp;=&nbsp;GenericDelegate.DelegateFun;<br />
                <img align="top" 
                    src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Response.Write(delegate2(DateTime.Now));<br />
                <img align="top" 
                    src="http://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockEnd.gif" />&nbsp;&nbsp;&nbsp;&nbsp;}</span></span><span 
                    style="COLOR: #000000"><br />
                <img align="top" 
                    src="http://www.cnblogs.com/Images/OutliningIndicators/ExpandedBlockEnd.gif" />}</span></span></div>
            运行结果<br />
            Hello, aabbcc<br />
            Time, 2007-2-10 22:59:26<br />
            <br />
            <br />
            抽象泛型类，派生约束<br />
            <div style="BORDER-RIGHT: #cccccc 1px solid; PADDING-RIGHT: 5px; BORDER-TOP: #cccccc 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 13px; PADDING-BOTTOM: 4px; BORDER-LEFT: #cccccc 1px solid; WIDTH: 98%; WORD-BREAK: break-all; PADDING-TOP: 4px; BORDER-BOTTOM: #cccccc 1px solid; BACKGROUND-COLOR: #eeeeee">
                <img id="Codehighlighter1_0_39_Open_Image" align="top" 
                    onclick="this.style.display='none'; Codehighlighter1_0_39_Open_Text.style.display='none'; Codehighlighter1_0_39_Closed_Image.style.display='inline'; Codehighlighter1_0_39_Closed_Text.style.display='inline';" 
                    src="http://www.cnblogs.com/Images/OutliningIndicators/ExpandedBlockStart.gif" /><img 
                    id="Codehighlighter1_0_39_Closed_Image" align="top" 
                    onclick="this.style.display='none'; Codehighlighter1_0_39_Closed_Text.style.display='none'; Codehighlighter1_0_39_Open_Image.style.display='inline'; Codehighlighter1_0_39_Open_Text.style.display='inline';" 
                    src="http://www.cnblogs.com/Images/OutliningIndicators/ContractedBlock.gif" /><span 
                    id="Codehighlighter1_0_39_Closed_Text" 
                    style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff">/**/</span><span 
                    id="Codehighlighter1_0_39_Open_Text"><span style="COLOR: #008000">/*---<br />
                <img align="top" 
                    src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" />&nbsp;*&nbsp;如何&nbsp;使用&nbsp;和&nbsp;继承&nbsp;抽象泛型类&nbsp;<br />
                <img align="top" 
                    src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" />&nbsp;*&nbsp;派生约束<br />
                <img align="top" 
                    src="http://www.cnblogs.com/Images/OutliningIndicators/ExpandedBlockEnd.gif" />---*/</span></span><span 
                    style="COLOR: #000000"><br />
                <img align="top" 
                    src="http://www.cnblogs.com/Images/OutliningIndicators/None.gif" /></span><span 
                    style="COLOR: #0000ff">using</span><span style="COLOR: #000000">&nbsp;System;<br />
                <img align="top" 
                    src="http://www.cnblogs.com/Images/OutliningIndicators/None.gif" /></span><span 
                    style="COLOR: #0000ff">using</span><span style="COLOR: #000000">&nbsp;System.Collections.Generic;<br />
                <img align="top" 
                    src="http://www.cnblogs.com/Images/OutliningIndicators/None.gif" /><br />
                <img align="top" 
                    src="http://www.cnblogs.com/Images/OutliningIndicators/None.gif" /></span><span 
                    style="COLOR: #008000">//&nbsp;泛型抽象类<br />
                <img align="top" 
                    src="http://www.cnblogs.com/Images/OutliningIndicators/None.gif" /></span><span 
                    style="COLOR: #0000ff">public</span><span style="COLOR: #000000">&nbsp;</span><span 
                    style="COLOR: #0000ff">abstract</span><span style="COLOR: #000000">&nbsp;</span><span 
                    style="COLOR: #0000ff">class</span><span style="COLOR: #000000">&nbsp;GenericParent<br />
                <img id="Codehighlighter1_135_370_Open_Image" align="top" 
                    onclick="this.style.display='none'; Codehighlighter1_135_370_Open_Text.style.display='none'; Codehighlighter1_135_370_Closed_Image.style.display='inline'; Codehighlighter1_135_370_Closed_Text.style.display='inline';" 
                    src="http://www.cnblogs.com/Images/OutliningIndicators/ExpandedBlockStart.gif" /><img 
                    id="Codehighlighter1_135_370_Closed_Image" align="top" 
                    onclick="this.style.display='none'; Codehighlighter1_135_370_Closed_Text.style.display='none'; Codehighlighter1_135_370_Open_Image.style.display='inline'; Codehighlighter1_135_370_Open_Text.style.display='inline';" 
                    src="http://www.cnblogs.com/Images/OutliningIndicators/ContractedBlock.gif" /></span><span 
                    id="Codehighlighter1_135_370_Closed_Text" 
                    style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><img 
                    src="http://www.cnblogs.com/Images/dot.gif" /></span><span 
                    id="Codehighlighter1_135_370_Open_Text"><span style="COLOR: #000000">{<br />
                <img align="top" 
                    src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" />&nbsp;&nbsp;&nbsp;&nbsp;</span><span 
                    style="COLOR: #008000">//&nbsp;泛型抽象方法，返回值为一个泛型，加一个约束使泛型X要继承自泛型Y<br />
                <img align="top" 
                    src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" /></span><span 
                    style="COLOR: #000000">&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #0000ff">public</span><span 
                    style="COLOR: #000000">&nbsp;</span><span style="COLOR: #0000ff">abstract</span><span 
                    style="COLOR: #000000">&nbsp;X&nbsp;Output&lt;X,&nbsp;Y&gt;(X&nbsp;x,&nbsp;Y&nbsp;y)&nbsp;where&nbsp;X&nbsp;:&nbsp;Y;<br />
                <img align="top" 
                    src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" /><br />
                <img align="top" 
                    src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" />&nbsp;&nbsp;&nbsp;&nbsp;</span><span 
                    style="COLOR: #008000">//&nbsp;泛型抽象方法，返回值为一个string类型，加一个约束使泛型X要继承自泛型Y<br />
                <img align="top" 
                    src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" /></span><span 
                    style="COLOR: #000000">&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #0000ff">public</span><span 
                    style="COLOR: #000000">&nbsp;</span><span style="COLOR: #0000ff">abstract</span><span 
                    style="COLOR: #000000">&nbsp;</span><span style="COLOR: #0000ff">string</span><span 
                    style="COLOR: #000000">&nbsp;Output2&lt;X&gt;(X&nbsp;x)&nbsp;where&nbsp;X&nbsp;:&nbsp;System.ComponentModel.IListSource;<br />
                <img align="top" 
                    src="http://www.cnblogs.com/Images/OutliningIndicators/ExpandedBlockEnd.gif" />}</span></span><span 
                    style="COLOR: #000000"><br />
                <img align="top" 
                    src="http://www.cnblogs.com/Images/OutliningIndicators/None.gif" /><br />
                <img align="top" 
                    src="http://www.cnblogs.com/Images/OutliningIndicators/None.gif" /></span><span 
                    style="COLOR: #0000ff">public</span><span style="COLOR: #000000">&nbsp;</span><span 
                    style="COLOR: #0000ff">class</span><span style="COLOR: #000000">&nbsp;GenericChild&nbsp;:&nbsp;GenericParent<br />
                <img id="Codehighlighter1_415_623_Open_Image" align="top" 
                    onclick="this.style.display='none'; Codehighlighter1_415_623_Open_Text.style.display='none'; Codehighlighter1_415_623_Closed_Image.style.display='inline'; Codehighlighter1_415_623_Closed_Text.style.display='inline';" 
                    src="http://www.cnblogs.com/Images/OutliningIndicators/ExpandedBlockStart.gif" /><img 
                    id="Codehighlighter1_415_623_Closed_Image" align="top" 
                    onclick="this.style.display='none'; Codehighlighter1_415_623_Closed_Text.style.display='none'; Codehighlighter1_415_623_Open_Image.style.display='inline'; Codehighlighter1_415_623_Open_Text.style.display='inline';" 
                    src="http://www.cnblogs.com/Images/OutliningIndicators/ContractedBlock.gif" /></span><span 
                    id="Codehighlighter1_415_623_Closed_Text" 
                    style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><img 
                    src="http://www.cnblogs.com/Images/dot.gif" /></span><span 
                    id="Codehighlighter1_415_623_Open_Text"><span style="COLOR: #000000">{<br />
                <img align="top" 
                    src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" />&nbsp;&nbsp;&nbsp;&nbsp;</span><span 
                    style="COLOR: #008000">//&nbsp;重写抽象类的泛型方法<br />
                <img align="top" 
                    src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" /></span><span 
                    style="COLOR: #000000">&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #0000ff">public</span><span 
                    style="COLOR: #000000">&nbsp;</span><span style="COLOR: #0000ff">override</span><span 
                    style="COLOR: #000000">&nbsp;T&nbsp;Output&lt;T,&nbsp;Z&gt;(T&nbsp;t,&nbsp;Z&nbsp;z)<br />
                <img id="Codehighlighter1_484_508_Open_Image" align="top" 
                    onclick="this.style.display='none'; Codehighlighter1_484_508_Open_Text.style.display='none'; Codehighlighter1_484_508_Closed_Image.style.display='inline'; Codehighlighter1_484_508_Closed_Text.style.display='inline';" 
                    src="http://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif" /><img 
                    id="Codehighlighter1_484_508_Closed_Image" align="top" 
                    onclick="this.style.display='none'; Codehighlighter1_484_508_Closed_Text.style.display='none'; Codehighlighter1_484_508_Open_Image.style.display='inline'; Codehighlighter1_484_508_Open_Text.style.display='inline';" 
                    src="http://www.cnblogs.com/Images/OutliningIndicators/ContractedSubBlock.gif" />&nbsp;&nbsp;&nbsp;&nbsp;</span><span 
                    id="Codehighlighter1_484_508_Closed_Text" 
                    style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><img 
                    src="http://www.cnblogs.com/Images/dot.gif" /></span><span 
                    id="Codehighlighter1_484_508_Open_Text"><span style="COLOR: #000000">{<br />
                <img align="top" 
                    src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span 
                    style="COLOR: #0000ff">return</span><span style="COLOR: #000000">&nbsp;t;<br />
                <img align="top" 
                    src="http://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockEnd.gif" />&nbsp;&nbsp;&nbsp;&nbsp;}</span></span><span 
                    style="COLOR: #000000"><br />
                <img align="top" 
                    src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" /><br />
                <img align="top" 
                    src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" />&nbsp;&nbsp;&nbsp;&nbsp;</span><span 
                    style="COLOR: #008000">//&nbsp;重写抽象类的泛型方法<br />
                <img align="top" 
                    src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" /></span><span 
                    style="COLOR: #000000">&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #0000ff">public</span><span 
                    style="COLOR: #000000">&nbsp;</span><span style="COLOR: #0000ff">override</span><span 
                    style="COLOR: #000000">&nbsp;</span><span style="COLOR: #0000ff">string</span><span 
                    style="COLOR: #000000">&nbsp;Output2&lt;T&gt;(T&nbsp;t)<br />
                <img id="Codehighlighter1_576_621_Open_Image" align="top" 
                    onclick="this.style.display='none'; Codehighlighter1_576_621_Open_Text.style.display='none'; Codehighlighter1_576_621_Closed_Image.style.display='inline'; Codehighlighter1_576_621_Closed_Text.style.display='inline';" 
                    src="http://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif" /><img 
                    id="Codehighlighter1_576_621_Closed_Image" align="top" 
                    onclick="this.style.display='none'; Codehighlighter1_576_621_Closed_Text.style.display='none'; Codehighlighter1_576_621_Open_Image.style.display='inline'; Codehighlighter1_576_621_Open_Text.style.display='inline';" 
                    src="http://www.cnblogs.com/Images/OutliningIndicators/ContractedSubBlock.gif" />&nbsp;&nbsp;&nbsp;&nbsp;</span><span 
                    id="Codehighlighter1_576_621_Closed_Text" 
                    style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><img 
                    src="http://www.cnblogs.com/Images/dot.gif" /></span><span 
                    id="Codehighlighter1_576_621_Open_Text"><span style="COLOR: #000000">{<br />
                <img align="top" 
                    src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span 
                    style="COLOR: #0000ff">return</span><span style="COLOR: #000000">&nbsp;t.GetType().ToString();<br />
                <img align="top" 
                    src="http://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockEnd.gif" />&nbsp;&nbsp;&nbsp;&nbsp;}</span></span><span 
                    style="COLOR: #000000"><br />
                <img align="top" 
                    src="http://www.cnblogs.com/Images/OutliningIndicators/ExpandedBlockEnd.gif" />}</span></span><span 
                    style="COLOR: #000000"><br />
                <img align="top" 
                    src="http://www.cnblogs.com/Images/OutliningIndicators/None.gif" /><br />
                <img align="top" 
                    src="http://www.cnblogs.com/Images/OutliningIndicators/None.gif" /><br />
                <img align="top" 
                    src="http://www.cnblogs.com/Images/OutliningIndicators/None.gif" /></span><span 
                    style="COLOR: #0000ff">public</span><span style="COLOR: #000000">&nbsp;partial&nbsp;</span><span 
                    style="COLOR: #0000ff">class</span><span style="COLOR: #000000">&nbsp;Generic_Abstract&nbsp;:&nbsp;System.Web.UI.Page<br />
                <img id="Codehighlighter1_686_1030_Open_Image" align="top" 
                    onclick="this.style.display='none'; Codehighlighter1_686_1030_Open_Text.style.display='none'; Codehighlighter1_686_1030_Closed_Image.style.display='inline'; Codehighlighter1_686_1030_Closed_Text.style.display='inline';" 
                    src="http://www.cnblogs.com/Images/OutliningIndicators/ExpandedBlockStart.gif" /><img 
                    id="Codehighlighter1_686_1030_Closed_Image" align="top" 
                    onclick="this.style.display='none'; Codehighlighter1_686_1030_Closed_Text.style.display='none'; Codehighlighter1_686_1030_Open_Image.style.display='inline'; Codehighlighter1_686_1030_Open_Text.style.display='inline';" 
                    src="http://www.cnblogs.com/Images/OutliningIndicators/ContractedBlock.gif" /></span><span 
                    id="Codehighlighter1_686_1030_Closed_Text" 
                    style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><img 
                    src="http://www.cnblogs.com/Images/dot.gif" /></span><span 
                    id="Codehighlighter1_686_1030_Open_Text"><span style="COLOR: #000000">{<br />
                <img align="top" 
                    src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" />&nbsp;&nbsp;&nbsp;&nbsp;</span><span 
                    style="COLOR: #0000ff">protected</span><span style="COLOR: #000000">&nbsp;</span><span 
                    style="COLOR: #0000ff">void</span><span style="COLOR: #000000">&nbsp;Page_Load(</span><span 
                    style="COLOR: #0000ff">object</span><span style="COLOR: #000000">&nbsp;sender,&nbsp;EventArgs&nbsp;e)<br />
                <img id="Codehighlighter1_749_1028_Open_Image" align="top" 
                    onclick="this.style.display='none'; Codehighlighter1_749_1028_Open_Text.style.display='none'; Codehighlighter1_749_1028_Closed_Image.style.display='inline'; Codehighlighter1_749_1028_Closed_Text.style.display='inline';" 
                    src="http://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif" /><img 
                    id="Codehighlighter1_749_1028_Closed_Image" align="top" 
                    onclick="this.style.display='none'; Codehighlighter1_749_1028_Closed_Text.style.display='none'; Codehighlighter1_749_1028_Open_Image.style.display='inline'; Codehighlighter1_749_1028_Open_Text.style.display='inline';" 
                    src="http://www.cnblogs.com/Images/OutliningIndicators/ContractedSubBlock.gif" />&nbsp;&nbsp;&nbsp;&nbsp;</span><span 
                    id="Codehighlighter1_749_1028_Closed_Text" 
                    style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><img 
                    src="http://www.cnblogs.com/Images/dot.gif" /></span><span 
                    id="Codehighlighter1_749_1028_Open_Text"><span style="COLOR: #000000">{<br />
                <img align="top" 
                    src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;GenericChild&nbsp;gc&nbsp;=&nbsp;</span><span 
                    style="COLOR: #0000ff">new</span><span style="COLOR: #000000">&nbsp;GenericChild();<br />
                <img align="top" 
                    src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Response.Write(gc.Output&lt;</span><span 
                    style="COLOR: #0000ff">string</span><span style="COLOR: #000000">,&nbsp;IComparable&gt;(&quot;aaa&quot;,&nbsp;&quot;xxx&quot;));<br />
                <img align="top" 
                    src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Response.Write(&quot;&lt;br&nbsp;/&gt;&quot;);<br />
                <img align="top" 
                    src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" /><br />
                <img align="top" 
                    src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Response.Write(gc.Output2&lt;System.Data.DataTable&gt;(</span><span 
                    style="COLOR: #0000ff">new</span><span style="COLOR: #000000">&nbsp;System.Data.DataTable()));<br />
                <img align="top" 
                    src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Response.Write(&quot;&lt;br&nbsp;/&gt;&quot;);<br />
                <img align="top" 
                    src="http://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockEnd.gif" />&nbsp;&nbsp;&nbsp;&nbsp;}</span></span><span 
                    style="COLOR: #000000"><br />
                <img align="top" 
                    src="http://www.cnblogs.com/Images/OutliningIndicators/ExpandedBlockEnd.gif" />}</span></span></div>
            运行结果<br />
            aaa<br />
            System.Data.DataTable<br />
            <br />
            <br />
            泛型接口，派生约束，构造函数约束<br />
            <div style="BORDER-RIGHT: #cccccc 1px solid; PADDING-RIGHT: 5px; BORDER-TOP: #cccccc 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 13px; PADDING-BOTTOM: 4px; BORDER-LEFT: #cccccc 1px solid; WIDTH: 98%; WORD-BREAK: break-all; PADDING-TOP: 4px; BORDER-BOTTOM: #cccccc 1px solid; BACKGROUND-COLOR: #eeeeee">
                <img id="Codehighlighter1_0_51_Open_Image" align="top" 
                    onclick="this.style.display='none'; Codehighlighter1_0_51_Open_Text.style.display='none'; Codehighlighter1_0_51_Closed_Image.style.display='inline'; Codehighlighter1_0_51_Closed_Text.style.display='inline';" 
                    src="http://www.cnblogs.com/Images/OutliningIndicators/ExpandedBlockStart.gif" /><img 
                    id="Codehighlighter1_0_51_Closed_Image" align="top" 
                    onclick="this.style.display='none'; Codehighlighter1_0_51_Closed_Text.style.display='none'; Codehighlighter1_0_51_Open_Image.style.display='inline'; Codehighlighter1_0_51_Open_Text.style.display='inline';" 
                    src="http://www.cnblogs.com/Images/OutliningIndicators/ContractedBlock.gif" /><span 
                    id="Codehighlighter1_0_51_Closed_Text" 
                    style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff">/**/</span><span 
                    id="Codehighlighter1_0_51_Open_Text"><span style="COLOR: #008000">/*---<br />
                <img align="top" 
                    src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" />&nbsp;*&nbsp;如何&nbsp;使用&nbsp;泛型接口<br />
                <img align="top" 
                    src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" />&nbsp;*&nbsp;派生约束<br />
                <img align="top" 
                    src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" />&nbsp;*&nbsp;构造函数约束（如果实例化的话）<br />
                <img align="top" 
                    src="http://www.cnblogs.com/Images/OutliningIndicators/ExpandedBlockEnd.gif" />---*/</span></span><span 
                    style="COLOR: #000000"><br />
                <img align="top" 
                    src="http://www.cnblogs.com/Images/OutliningIndicators/None.gif" /></span><span 
                    style="COLOR: #0000ff">using</span><span style="COLOR: #000000">&nbsp;System;<br />
                <img align="top" 
                    src="http://www.cnblogs.com/Images/OutliningIndicators/None.gif" /></span><span 
                    style="COLOR: #0000ff">using</span><span style="COLOR: #000000">&nbsp;System.Collections.Generic;<br />
                <img align="top" 
                    src="http://www.cnblogs.com/Images/OutliningIndicators/None.gif" /><br />
                <img align="top" 
                    src="http://www.cnblogs.com/Images/OutliningIndicators/None.gif" /></span><span 
                    style="COLOR: #008000">//&nbsp;泛型接口<br />
                <img align="top" 
                    src="http://www.cnblogs.com/Images/OutliningIndicators/None.gif" /></span><span 
                    style="COLOR: #0000ff">public</span><span style="COLOR: #000000">&nbsp;</span><span 
                    style="COLOR: #0000ff">interface</span><span style="COLOR: #000000">&nbsp;IGenericInterface&lt;T&gt;<br />
                <img id="Codehighlighter1_148_174_Open_Image" align="top" 
                    onclick="this.style.display='none'; Codehighlighter1_148_174_Open_Text.style.display='none'; Codehighlighter1_148_174_Closed_Image.style.display='inline'; Codehighlighter1_148_174_Closed_Text.style.display='inline';" 
                    src="http://www.cnblogs.com/Images/OutliningIndicators/ExpandedBlockStart.gif" /><img 
                    id="Codehighlighter1_148_174_Closed_Image" align="top" 
                    onclick="this.style.display='none'; Codehighlighter1_148_174_Closed_Text.style.display='none'; Codehighlighter1_148_174_Open_Image.style.display='inline'; Codehighlighter1_148_174_Open_Text.style.display='inline';" 
                    src="http://www.cnblogs.com/Images/OutliningIndicators/ContractedBlock.gif" /></span><span 
                    id="Codehighlighter1_148_174_Closed_Text" 
                    style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><img 
                    src="http://www.cnblogs.com/Images/dot.gif" /></span><span 
                    id="Codehighlighter1_148_174_Open_Text"><span style="COLOR: #000000">{<br />
                <img align="top" 
                    src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" />&nbsp;&nbsp;&nbsp;&nbsp;T&nbsp;CreateInstance();<br />
                <img align="top" 
                    src="http://www.cnblogs.com/Images/OutliningIndicators/ExpandedBlockEnd.gif" />}</span></span><span 
                    style="COLOR: #000000"><br />
                <img align="top" 
                    src="http://www.cnblogs.com/Images/OutliningIndicators/None.gif" /><br />
                <img align="top" 
                    src="http://www.cnblogs.com/Images/OutliningIndicators/None.gif" /></span><span 
                    style="COLOR: #008000">//&nbsp;实现上面泛型接口的泛型类<br />
                <img align="top" 
                    src="http://www.cnblogs.com/Images/OutliningIndicators/None.gif" />//&nbsp;派生约束where&nbsp;T&nbsp;:&nbsp;TI（T要继承自TI）<br />
                <img align="top" 
                    src="http://www.cnblogs.com/Images/OutliningIndicators/None.gif" />//&nbsp;构造函数约束where&nbsp;T&nbsp;:&nbsp;new()（T可以实例化）<br />
                <img align="top" 
                    src="http://www.cnblogs.com/Images/OutliningIndicators/None.gif" /></span><span 
                    style="COLOR: #0000ff">public</span><span style="COLOR: #000000">&nbsp;</span><span 
                    style="COLOR: #0000ff">class</span><span style="COLOR: #000000">&nbsp;Factory&lt;T,&nbsp;TI&gt;&nbsp;:&nbsp;IGenericInterface&lt;TI&gt;<br />
                <img align="top" 
                    src="http://www.cnblogs.com/Images/OutliningIndicators/None.gif" />&nbsp;&nbsp;&nbsp;&nbsp;where&nbsp;T&nbsp;:&nbsp;TI,&nbsp;</span><span 
                    style="COLOR: #0000ff">new</span><span style="COLOR: #000000">()<br />
                <img id="Codehighlighter1_331_400_Open_Image" align="top" 
                    onclick="this.style.display='none'; Codehighlighter1_331_400_Open_Text.style.display='none'; Codehighlighter1_331_400_Closed_Image.style.display='inline'; Codehighlighter1_331_400_Closed_Text.style.display='inline';" 
                    src="http://www.cnblogs.com/Images/OutliningIndicators/ExpandedBlockStart.gif" /><img 
                    id="Codehighlighter1_331_400_Closed_Image" align="top" 
                    onclick="this.style.display='none'; Codehighlighter1_331_400_Closed_Text.style.display='none'; Codehighlighter1_331_400_Open_Image.style.display='inline'; Codehighlighter1_331_400_Open_Text.style.display='inline';" 
                    src="http://www.cnblogs.com/Images/OutliningIndicators/ContractedBlock.gif" /></span><span 
                    id="Codehighlighter1_331_400_Closed_Text" 
                    style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><img 
                    src="http://www.cnblogs.com/Images/dot.gif" /></span><span 
                    id="Codehighlighter1_331_400_Open_Text"><span style="COLOR: #000000">{<br />
                <img align="top" 
                    src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" />&nbsp;&nbsp;&nbsp;&nbsp;</span><span 
                    style="COLOR: #0000ff">public</span><span style="COLOR: #000000">&nbsp;TI&nbsp;CreateInstance()<br />
                <img id="Codehighlighter1_368_398_Open_Image" align="top" 
                    onclick="this.style.display='none'; Codehighlighter1_368_398_Open_Text.style.display='none'; Codehighlighter1_368_398_Closed_Image.style.display='inline'; Codehighlighter1_368_398_Closed_Text.style.display='inline';" 
                    src="http://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif" /><img 
                    id="Codehighlighter1_368_398_Closed_Image" align="top" 
                    onclick="this.style.display='none'; Codehighlighter1_368_398_Closed_Text.style.display='none'; Codehighlighter1_368_398_Open_Image.style.display='inline'; Codehighlighter1_368_398_Open_Text.style.display='inline';" 
                    src="http://www.cnblogs.com/Images/OutliningIndicators/ContractedSubBlock.gif" />&nbsp;&nbsp;&nbsp;&nbsp;</span><span 
                    id="Codehighlighter1_368_398_Closed_Text" 
                    style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><img 
                    src="http://www.cnblogs.com/Images/dot.gif" /></span><span 
                    id="Codehighlighter1_368_398_Open_Text"><span style="COLOR: #000000">{<br />
                <img align="top" 
                    src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span 
                    style="COLOR: #0000ff">return</span><span style="COLOR: #000000">&nbsp;</span><span 
                    style="COLOR: #0000ff">new</span><span style="COLOR: #000000">&nbsp;T();<br />
                <img align="top" 
                    src="http://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockEnd.gif" />&nbsp;&nbsp;&nbsp;&nbsp;}</span></span><span 
                    style="COLOR: #000000"><br />
                <img align="top" 
                    src="http://www.cnblogs.com/Images/OutliningIndicators/ExpandedBlockEnd.gif" />}</span></span><span 
                    style="COLOR: #000000"><br />
                <img align="top" 
                    src="http://www.cnblogs.com/Images/OutliningIndicators/None.gif" /><br />
                <img align="top" 
                    src="http://www.cnblogs.com/Images/OutliningIndicators/None.gif" /><br />
                <img align="top" 
                    src="http://www.cnblogs.com/Images/OutliningIndicators/None.gif" /></span><span 
                    style="COLOR: #0000ff">public</span><span style="COLOR: #000000">&nbsp;partial&nbsp;</span><span 
                    style="COLOR: #0000ff">class</span><span style="COLOR: #000000">&nbsp;Generic_Interface&nbsp;:&nbsp;System.Web.UI.Page<br />
                <img id="Codehighlighter1_464_797_Open_Image" align="top" 
                    onclick="this.style.display='none'; Codehighlighter1_464_797_Open_Text.style.display='none'; Codehighlighter1_464_797_Closed_Image.style.display='inline'; Codehighlighter1_464_797_Closed_Text.style.display='inline';" 
                    src="http://www.cnblogs.com/Images/OutliningIndicators/ExpandedBlockStart.gif" /><img 
                    id="Codehighlighter1_464_797_Closed_Image" align="top" 
                    onclick="this.style.display='none'; Codehighlighter1_464_797_Closed_Text.style.display='none'; Codehighlighter1_464_797_Open_Image.style.display='inline'; Codehighlighter1_464_797_Open_Text.style.display='inline';" 
                    src="http://www.cnblogs.com/Images/OutliningIndicators/ContractedBlock.gif" /></span><span 
                    id="Codehighlighter1_464_797_Closed_Text" 
                    style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><img 
                    src="http://www.cnblogs.com/Images/dot.gif" /></span><span 
                    id="Codehighlighter1_464_797_Open_Text"><span style="COLOR: #000000">{<br />
                <img align="top" 
                    src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" />&nbsp;&nbsp;&nbsp;&nbsp;</span><span 
                    style="COLOR: #0000ff">protected</span><span style="COLOR: #000000">&nbsp;</span><span 
                    style="COLOR: #0000ff">void</span><span style="COLOR: #000000">&nbsp;Page_Load(</span><span 
                    style="COLOR: #0000ff">object</span><span style="COLOR: #000000">&nbsp;sender,&nbsp;EventArgs&nbsp;e)<br />
                <img id="Codehighlighter1_527_795_Open_Image" align="top" 
                    onclick="this.style.display='none'; Codehighlighter1_527_795_Open_Text.style.display='none'; Codehighlighter1_527_795_Closed_Image.style.display='inline'; Codehighlighter1_527_795_Closed_Text.style.display='inline';" 
                    src="http://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif" /><img 
                    id="Codehighlighter1_527_795_Closed_Image" align="top" 
                    onclick="this.style.display='none'; Codehighlighter1_527_795_Closed_Text.style.display='none'; Codehighlighter1_527_795_Open_Image.style.display='inline'; Codehighlighter1_527_795_Open_Text.style.display='inline';" 
                    src="http://www.cnblogs.com/Images/OutliningIndicators/ContractedSubBlock.gif" />&nbsp;&nbsp;&nbsp;&nbsp;</span><span 
                    id="Codehighlighter1_527_795_Closed_Text" 
                    style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><img 
                    src="http://www.cnblogs.com/Images/dot.gif" /></span><span 
                    id="Codehighlighter1_527_795_Open_Text"><span style="COLOR: #000000">{<br />
                <img align="top" 
                    src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;IGenericInterface&lt;System.ComponentModel.IListSource&gt;&nbsp;factory&nbsp;=<br />
                <img align="top" 
                    src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span 
                    style="COLOR: #0000ff">new</span><span style="COLOR: #000000">&nbsp;Factory&lt;System.Data.DataTable,&nbsp;System.ComponentModel.IListSource&gt;();<br />
                <img align="top" 
                    src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" /><br />
                <img align="top" 
                    src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Response.Write(factory.CreateInstance().GetType().ToString());<br />
                <img align="top" 
                    src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Response.Write(&quot;&lt;br&nbsp;/&gt;&quot;);<br />
                <img align="top" 
                    src="http://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockEnd.gif" />&nbsp;&nbsp;&nbsp;&nbsp;}</span></span><span 
                    style="COLOR: #000000"><br />
                <img align="top" 
                    src="http://www.cnblogs.com/Images/OutliningIndicators/ExpandedBlockEnd.gif" />}</span></span><span 
                    style="COLOR: #000000"><br />
                <img align="top" 
                    src="http://www.cnblogs.com/Images/OutliningIndicators/None.gif" /></span></div>
            运行结果<br />
            System.Data.DataTable<br />
            <br />
            <br />
            其它<br />
            <div style="BORDER-RIGHT: #cccccc 1px solid; PADDING-RIGHT: 5px; BORDER-TOP: #cccccc 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 13px; PADDING-BOTTOM: 4px; BORDER-LEFT: #cccccc 1px solid; WIDTH: 98%; WORD-BREAK: break-all; PADDING-TOP: 4px; BORDER-BOTTOM: #cccccc 1px solid; BACKGROUND-COLOR: #eeeeee">
                <img id="Codehighlighter1_0_19_Open_Image" align="top" 
                    onclick="this.style.display='none'; Codehighlighter1_0_19_Open_Text.style.display='none'; Codehighlighter1_0_19_Closed_Image.style.display='inline'; Codehighlighter1_0_19_Closed_Text.style.display='inline';" 
                    src="http://www.cnblogs.com/Images/OutliningIndicators/ExpandedBlockStart.gif" /><img 
                    id="Codehighlighter1_0_19_Closed_Image" align="top" 
                    onclick="this.style.display='none'; Codehighlighter1_0_19_Closed_Text.style.display='none'; Codehighlighter1_0_19_Open_Image.style.display='inline'; Codehighlighter1_0_19_Open_Text.style.display='inline';" 
                    src="http://www.cnblogs.com/Images/OutliningIndicators/ContractedBlock.gif" /><span 
                    id="Codehighlighter1_0_19_Closed_Text" 
                    style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff">/**/</span><span 
                    id="Codehighlighter1_0_19_Open_Text"><span style="COLOR: #008000">/*---<br />
                <img align="top" 
                    src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" />&nbsp;*&nbsp;泛型&nbsp;其它<br />
                <img align="top" 
                    src="http://www.cnblogs.com/Images/OutliningIndicators/ExpandedBlockEnd.gif" />---*/</span></span><span 
                    style="COLOR: #000000"><br />
                <img align="top" 
                    src="http://www.cnblogs.com/Images/OutliningIndicators/None.gif" /></span><span 
                    style="COLOR: #0000ff">using</span><span style="COLOR: #000000">&nbsp;System;<br />
                <img align="top" 
                    src="http://www.cnblogs.com/Images/OutliningIndicators/None.gif" /></span><span 
                    style="COLOR: #0000ff">using</span><span style="COLOR: #000000">&nbsp;System.Collections.Generic;<br />
                <img align="top" 
                    src="http://www.cnblogs.com/Images/OutliningIndicators/None.gif" /><br />
                <img align="top" 
                    src="http://www.cnblogs.com/Images/OutliningIndicators/None.gif" /></span><span 
                    style="COLOR: #008000">//&nbsp;泛型也可以使用别名<br />
                <img align="top" 
                    src="http://www.cnblogs.com/Images/OutliningIndicators/None.gif" /></span><span 
                    style="COLOR: #0000ff">using</span><span style="COLOR: #000000">&nbsp;MyList&nbsp;=&nbsp;System.Collections.Generic.List&lt;</span><span 
                    style="COLOR: #0000ff">string</span><span style="COLOR: #000000">&gt;;<br />
                <img align="top" 
                    src="http://www.cnblogs.com/Images/OutliningIndicators/None.gif" /><br />
                <img align="top" 
                    src="http://www.cnblogs.com/Images/OutliningIndicators/None.gif" /></span><span 
                    style="COLOR: #0000ff">public</span><span style="COLOR: #000000">&nbsp;partial&nbsp;</span><span 
                    style="COLOR: #0000ff">class</span><span style="COLOR: #000000">&nbsp;Generic_Other&nbsp;:&nbsp;System.Web.UI.Page<br />
                <img id="Codehighlighter1_196_603_Open_Image" align="top" 
                    onclick="this.style.display='none'; Codehighlighter1_196_603_Open_Text.style.display='none'; Codehighlighter1_196_603_Closed_Image.style.display='inline'; Codehighlighter1_196_603_Closed_Text.style.display='inline';" 
                    src="http://www.cnblogs.com/Images/OutliningIndicators/ExpandedBlockStart.gif" /><img 
                    id="Codehighlighter1_196_603_Closed_Image" align="top" 
                    onclick="this.style.display='none'; Codehighlighter1_196_603_Closed_Text.style.display='none'; Codehighlighter1_196_603_Open_Image.style.display='inline'; Codehighlighter1_196_603_Open_Text.style.display='inline';" 
                    src="http://www.cnblogs.com/Images/OutliningIndicators/ContractedBlock.gif" /></span><span 
                    id="Codehighlighter1_196_603_Closed_Text" 
                    style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><img 
                    src="http://www.cnblogs.com/Images/dot.gif" /></span><span 
                    id="Codehighlighter1_196_603_Open_Text"><span style="COLOR: #000000">{<br />
                <img align="top" 
                    src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" />&nbsp;&nbsp;&nbsp;&nbsp;</span><span 
                    style="COLOR: #0000ff">protected</span><span style="COLOR: #000000">&nbsp;</span><span 
                    style="COLOR: #0000ff">void</span><span style="COLOR: #000000">&nbsp;Page_Load(</span><span 
                    style="COLOR: #0000ff">object</span><span style="COLOR: #000000">&nbsp;sender,&nbsp;EventArgs&nbsp;e)<br />
                <img id="Codehighlighter1_259_601_Open_Image" align="top" 
                    onclick="this.style.display='none'; Codehighlighter1_259_601_Open_Text.style.display='none'; Codehighlighter1_259_601_Closed_Image.style.display='inline'; Codehighlighter1_259_601_Closed_Text.style.display='inline';" 
                    src="http://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif" /><img 
                    id="Codehighlighter1_259_601_Closed_Image" align="top" 
                    onclick="this.style.display='none'; Codehighlighter1_259_601_Closed_Text.style.display='none'; Codehighlighter1_259_601_Open_Image.style.display='inline'; Codehighlighter1_259_601_Open_Text.style.display='inline';" 
                    src="http://www.cnblogs.com/Images/OutliningIndicators/ContractedSubBlock.gif" />&nbsp;&nbsp;&nbsp;&nbsp;</span><span 
                    id="Codehighlighter1_259_601_Closed_Text" 
                    style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><img 
                    src="http://www.cnblogs.com/Images/dot.gif" /></span><span 
                    id="Codehighlighter1_259_601_Open_Text"><span style="COLOR: #000000">{<br />
                <img align="top" 
                    src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;MyList&nbsp;ml&nbsp;=&nbsp;</span><span 
                    style="COLOR: #0000ff">new</span><span style="COLOR: #000000">&nbsp;MyList();<br />
                <img align="top" 
                    src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ml.Add(&quot;aaa&quot;);<br />
                <img align="top" 
                    src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ml.Add(&quot;bbb&quot;);<br />
                <img align="top" 
                    src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" /><br />
                <img align="top" 
                    src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Response.Write(ml[0]);<br />
                <img align="top" 
                    src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Response.Write(&quot;&lt;br&nbsp;/&gt;&quot;);<br />
                <img align="top" 
                    src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Response.Write(ml[1]);<br />
                <img align="top" 
                    src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" /><br />
                <img align="top" 
                    src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span 
                    style="COLOR: #008000">//&nbsp;其它说明<br />
                <img align="top" 
                    src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//&nbsp;值类型约束&nbsp;public&nbsp;class&nbsp;MyClass&lt;T&gt;&nbsp;where&nbsp;T&nbsp;:&nbsp;struct&nbsp;{&nbsp;}<br />
                <img align="top" 
                    src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//&nbsp;引用类型约束&nbsp;public&nbsp;class&nbsp;MyClass&lt;T&gt;&nbsp;where&nbsp;T&nbsp;:&nbsp;class&nbsp;{&nbsp;}<br />
                <img align="top" 
                    src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//&nbsp;没有泛型属性<br />
                <img align="top" 
                    src="http://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockEnd.gif" /></span><span 
                    style="COLOR: #000000">&nbsp;&nbsp;&nbsp;&nbsp;}</span></span><span style="COLOR: #000000"><br />
                <img align="top" 
                    src="http://www.cnblogs.com/Images/OutliningIndicators/ExpandedBlockEnd.gif" />}</span></span><span 
                    style="COLOR: #000000"><br />
                <img align="top" 
                    src="http://www.cnblogs.com/Images/OutliningIndicators/None.gif" /></span></div>
            运行结果<br />
            aaa<br />
            bbb<br />
            <br />
            <br />
            OK<br />
            <a href="http://www.cnblogs.com/Files/webabcd/CSharp.rar">[源码下载]</a>
        </div>
    
    </div>
    </form>
</body>
</html>
